import React, { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";

const Child = () => {
  const dispatch = useDispatch();
  const list = useSelector((state) => state.pro.list);

  useEffect(() => {
    dispatch({ type: "asyncGetList" });
    // eslint-disable-next-line
  }, []);

  return (
    <>
      <h3>child子组件</h3>
      <ul>
        {list.map((item) => (
          <li key={item.proid}>{item.proname}</li>
        ))}
      </ul>
    </>
  );
};

export default Child;
